/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 Redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BAOpeningHoursTopCell.m
//  redia-bapps-ios
//
//  Created by Henrik Lynbech on 05/11/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import "BAOpeningHoursTopLibraryCell.h"
#import "BALibrarySettings.h"
#import "LazyLoadManager.h"
#import "InfoGalleriImageUrlUtils.h"
#import "BAOpeningHoursViewController.h"

@interface BAOpeningHoursTopLibraryCell ()

@end

@implementation BAOpeningHoursTopLibraryCell

-(void)awakeFromNib
{
    [self setupLogo];
}


-(void)setupLogo
{
    NSString* resizeurl = [BAOpeningHoursViewController getOpeningHoursResizedLogoUrl];
    if (resizeurl!=nil && [resizeurl length]>0) {
        [[LazyLoadManager instance] lazyLoadUIImageFromUrl:resizeurl
                                         setScaleforRetina:YES
                                                 onSuccess:^(UIImage *image) {
                                                     self.libraryLogo.image = image;
                                                 }
                                                   onError:^(LazyLoaderErrorCode errorCode, NSString *errorMessage) {
                                                       self.libraryLogo.image = nil;
                                                   }
         ];
    } else {
        self.libraryLogo.image=nil;
    }
    
}


@end
